<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<mesoBoard.Data.Rank>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend><%= Html.ThemeImage("award_star_gold.png")%> Ranks</legend>

        <%= Html.ImageLink("Create Rank", Url.Action("CreateRank"), "~/Themes/Default/Images/medal_gold_1.png", "Create Rank", "image_link")%>
                       
        <table class="form_table"> 
        
            <tr>
                <th>Title</th>
                <th>Post Count</th>
                <th>Image</th>
                <th>Repeat</th>
                <th>Color</th>
                <th></th>
                <th></th>
            </tr>
            
            <% foreach(Rank r in Model){ %>
                <tr>
                    <td><%= r.Title %></td>
                    <td><%= r.IsRoleRank ? "N/A (Is a role rank)" : r.PostCount.ToString() %></td>
                    <td><%= string.IsNullOrWhiteSpace(r.Image) ? "" : Html.Image("~/Images/Ranks/"+r.Image).ToString() %></td>
                    <td><%= r.Repeat %></td>
                    <td><span style="color:<%= r.Color%>"><%= r.Color %></span></td>
                    <td><%= Html.ActionLink("Edit", "EditRank", new { RankID = r.RankID })%></td>
                    <td><%= Html.AdminConfirm("Delete", Url.Action("DeleteRank", new { RankID = r.RankID}), Url.Action("Ranks")) %></td>
                </tr>
            <%} %>
            
        </table>
        
    </fieldset>

</asp:Content>
